Optimal. Leaf size=90 \[ -\frac {i e x}{a}-\frac {i f x^2}{2 a}-\frac {2 i f \log \left (\cosh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}+\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {5676, 3399,
4269, 3556} \begin {gather*} -\frac {2 i f \log \left (\cosh \left (\frac {c}{2}+\frac {d x}{2}+\frac {i \pi }{4}\right )\right )}{a d^2}+\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {d x}{2}+\frac {i \pi }{4}\right )}{a d}-\frac {i e x}{a}-\frac {i f x^2}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3399
Rule 3556
Rule 4269
Rule 5676
Rubi steps
\begin {align*} \int \frac {(e+f x) \sinh (c+d x)}{a+i a \sinh (c+d x)} \, dx &=i \int \frac {e+f x}{a+i a \sinh (c+d x)} \, dx-\frac {i \int (e+f x) \, dx}{a}\\ &=-\frac {i e x}{a}-\frac {i f x^2}{2 a}+\frac {i \int (e+f x) \csc ^2\left (\frac {1}{2} \left (i c+\frac {\pi }{2}\right )+\frac {i d x}{2}\right ) \, dx}{2 a}\\ &=-\frac {i e x}{a}-\frac {i f x^2}{2 a}+\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {(i f) \int \coth \left (\frac {c}{2}-\frac {i \pi }{4}+\frac {d x}{2}\right ) \, dx}{a d}\\ &=-\frac {i e x}{a}-\frac {i f x^2}{2 a}-\frac {2 i f \log \left (\cosh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}+\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(239\) vs. \(2(90)=180\).
time = 0.41, size = 239, normalized size = 2.66 \begin {gather*} \frac {-2 d f x \cosh \left (c+\frac {d x}{2}\right )-i \cosh \left (\frac {d x}{2}\right ) \left (d^2 x (2 e+f x)+4 i f \text {ArcTan}\left (\text {sech}\left (c+\frac {d x}{2}\right ) \sinh \left (\frac {d x}{2}\right )\right )+2 f \log (\cosh (c+d x))\right )+4 i d e \sinh \left (\frac {d x}{2}\right )+2 i d f x \sinh \left (\frac {d x}{2}\right )+2 d^2 e x \sinh \left (c+\frac {d x}{2}\right )+d^2 f x^2 \sinh \left (c+\frac {d x}{2}\right )+4 i f \text {ArcTan}\left (\text {sech}\left (c+\frac {d x}{2}\right ) \sinh \left (\frac {d x}{2}\right )\right ) \sinh \left (c+\frac {d x}{2}\right )+2 f \log (\cosh (c+d x)) \sinh \left (c+\frac {d x}{2}\right )}{2 a d^2 \left (\cosh \left (\frac {c}{2}\right )+i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.27, size = 86, normalized size = 0.96
method | result | size |
risch | \(-\frac {i f \,x^{2}}{2 a}-\frac {i e x}{a}+\frac {2 i f x}{a d}+\frac {2 i f c}{a \,d^{2}}-\frac {2 \left (f x +e \right )}{d a \left ({\mathrm e}^{d x +c}-i\right )}-\frac {2 i f \ln \left ({\mathrm e}^{d x +c}-i\right )}{a \,d^{2}}\) | \(86\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 109, normalized size = 1.21 \begin {gather*} \frac {1}{2} \, f {\left (\frac {-i \, d x^{2} + {\left (d x^{2} e^{c} - 4 \, x e^{c}\right )} e^{\left (d x\right )}}{i \, a d e^{\left (d x + c\right )} + a d} - \frac {4 i \, \log \left ({\left (e^{\left (d x + c\right )} - i\right )} e^{\left (-c\right )}\right )}{a d^{2}}\right )} - {\left (\frac {i \, {\left (d x + c\right )}}{a d} + \frac {2}{{\left (a e^{\left (-d x - c\right )} + i \, a\right )} d}\right )} e \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 97, normalized size = 1.08 \begin {gather*} -\frac {d^{2} f x^{2} + 2 \, {\left (d^{2} x + 2 \, d\right )} e - {\left (-i \, d^{2} f x^{2} - 2 i \, d^{2} x e + 4 i \, d f x\right )} e^{\left (d x + c\right )} + 4 \, {\left (i \, f e^{\left (d x + c\right )} + f\right )} \log \left (e^{\left (d x + c\right )} - i\right )}{2 \, {\left (a d^{2} e^{\left (d x + c\right )} - i \, a d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.16, size = 73, normalized size = 0.81 \begin {gather*} \frac {- 2 e - 2 f x}{a d e^{c} e^{d x} - i a d} - \frac {i f x^{2}}{2 a} + \frac {x \left (- i d e + 2 i f\right )}{a d} - \frac {2 i f \log {\left (e^{d x} - i e^{- c} \right )}}{a d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 111, normalized size = 1.23 \begin {gather*} -\frac {i \, d^{2} f x^{2} e^{\left (d x + c\right )} + d^{2} f x^{2} + 2 i \, d^{2} e x e^{\left (d x + c\right )} + 2 \, d^{2} e x - 4 i \, d f x e^{\left (d x + c\right )} + 4 i \, f e^{\left (d x + c\right )} \log \left (e^{\left (d x + c\right )} - i\right ) + 4 \, d e + 4 \, f \log \left (e^{\left (d x + c\right )} - i\right )}{2 \, {\left (a d^{2} e^{\left (d x + c\right )} - i \, a d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.55, size = 74, normalized size = 0.82 \begin {gather*} -\frac {f\,x^2\,1{}\mathrm {i}}{2\,a}-\frac {2\,\left (e+f\,x\right )}{a\,d\,\left ({\mathrm {e}}^{c+d\,x}-\mathrm {i}\right )}+\frac {x\,\left (2\,f-d\,e\right )\,1{}\mathrm {i}}{a\,d}-\frac {f\,\ln \left ({\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c-\mathrm {i}\right )\,2{}\mathrm {i}}{a\,d^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________